package Thread;

public class Demo38 {

    private static int result = 0;

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{

            for(int i = 0;i < 10000;i ++){
                result ++;
            }
        });
        Thread t1 = new Thread(()->{

            for(int i = 0;i < 10000;i ++){
                result ++;
            }
        });
        t.start();
        t1.start();
        t.join();
        t1.join();


        System.out.println("result = " + result);
    }
}
